home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SGI Hot Mix 17
/
Hot Mix 17.iso
/
HM17_SGI
/
research
/
lib
/
pushd.pro
< prev
next >
Wrap
Text File
|
1997-07-08
|
962b
|
44 lines
; $Id: pushd.pro,v 1.3 1997/01/15 03:11:50 ali Exp $
;
; Copyright (c) 1989-1997, Research Systems, Inc. All rights reserved.
; Unauthorized reproduction prohibited.
;+
; NAME:
; PUSHD
;
; PURPOSE:
; Push a directory onto the top of the directory stack maintained
; by the PUSHD and POPD User Library procedures.
;
; CALLING SEQUENCE:
; PUSHD, Dir
;
; INPUTS:
; Dir: The directory to change to. The current directory will
; be pushed to the top of the directory stack.
;
; SIDE EFFECTS:
; The current directory is pushed onto the directory stack.
; It will be the next directory used by POPD.
;
; COMMON BLOCKS:
; DIR_STACK: Contains the stack.
;
; MODIFICATION HISTORY:
; 17, July, 1989, Written by AB, RSI.
;-
;
;
pro pushd,dir
COMMON DIR_STACK, DEPTH, STACK
on_error, 2 ; Return to caller on error
if (n_elements(DEPTH) eq 0) then depth = 0
CD, dir, CURRENT=cwd
if (DEPTH eq 0) then STACK = [CWD] else STACK = [CWD, STACK]
DEPTH = DEPTH + 1
end